$(function() {
	var editor = new baidu.editor.ui.Editor({
		textarea : 'fragment'
	});
	editor.render("myEditor");

	$('#fragment-form').submit(function() {
		var name = $.trim($('#name').val());
		if (name) {
			return true;
		} else {
			alert('请填写片断标记,以便在模板中引用。');
			return false;
		}
	});
});